// ==UserScript==
// @name           Przybronik Szafa
// @namespace      http://pl-the-west.googlecode.com/
// @description    Szafa dla przybornika, skrypt zakazany na większości świató TW
// @version        0.0.1
// @include        *.the-west.*/*
// @include        http://userscripts.org/scripts/source/103662.meta.js
// @exclude        www.the-west.*
// @exclude        forum.the-west.pl/*
// @require        http://userscripts.org/scripts/source/74144.user.js
// ==/UserScript==
//
// @history        Start zakazanego owocu :]
//
// ==/UserScript==

function GM_getValue(key,defaultVal) {
	var retValue = localStorage.getItem(key);
	if ( !retValue ) {
		return defaultVal;
		}
	return retValue;
	}

function GM_setValue(key,value) {
	localStorage.setItem(key, value);
	}

var SzafVer = "0.0.1";

try {
	ScriptUpdater.check(103662, SzafVer);
} catch(e) { }; // sprawdzenie aktualizacji

(function(f){var d=document,s=d.createElement('script');s.setAttribute('type','application/javascript');s.textContent = '('+f.toString()+')()';(d.body||d.head||d.documentElement).appendChild(s);s.parentNode.removeChild(s)})(function(){

window.addEvent('domready', function(){

pk2_odev_spam = function(){
	if (!pk2_odevalo4ka) return;
	wear_div = document.getElementById('window_inventory_content');
	if (!wear_div) {setTimeout(pk2_odev_spam,2000);return}
 ww=wear_div.getElementById('char_head');
 if (!ww) {setTimeout(pk2_odev_spam,2000);return}
 if (document.getElementById('pk2_wear_spam')) {setTimeout(pk2_odev_spam,5000);return};
        qwe=document.getElementById('window_inventory_title');
	qwe.innerHTML=qwe.innerHTML.replace('Przechowalnia','');
 var wear_spam = document.createElement('div');
 wear_spam.setAttribute('id', 'pk2_wear_spam');
 wear_spam.setAttribute('style', 'position: absolute; top: 1px; left: 5px; padding: 3px; margin: 0px;font-size:75%;');
 var wear_spam2 = document.createElement('div');
 wear_spam2.setAttribute('id', 'pk2_wear_spam2');
 wear_spam2.setAttribute('style', 'position: absolute; top: 1px; left: 140px; padding: 3px; margin: 0px;font-size:75%;');
 wear_div.parentNode.insertBefore(wear_spam,wear_div);
 wear_div.parentNode.insertBefore(wear_spam2,wear_div);
	var store_set_link = document.createElement('a');
	store_set_link.setAttribute('href', '#');
	store_set_link.setAttribute('title', 'Dopisz aktualny zestaw do listy');
	store_set_link.setAttribute('onclick', 'pk2_odev_spam_save(); return false;');
 store_set_link.setAttribute('style', 'color: white');
	store_set_link.textContent = 'Nowy';
	wear_spam.appendChild(store_set_link);
	var store_set_value = document.createElement('input');
	store_set_value.setAttribute('id','pk2_spam_new');
	store_set_value.setAttribute('type','text');
	store_set_value.setAttribute('size','20');
	store_set_value.setAttribute('value','Nazwa nowego zestawu...');
	store_set_value.setAttribute('class','pk2_sel');
	store_set_value.setAttribute('style','-moz-user-select: text; margin: 0px 3px;font-size:100%;');
	store_set_value.setAttribute('onClick','this.value=\"\"');
	store_set_value.setAttribute('onblur','this.value=!this.value?\"Nazwa nowego zestawu...\":this.value;');
	wear_spam.appendChild(store_set_value);
	var br_br = document.createElement('br');
	var store_rewrite_link = document.createElement('a');
	store_rewrite_link.setAttribute('href', '#');
	store_rewrite_link.setAttribute('title', 'Zmiana nazwy zestawu');
	store_rewrite_link.setAttribute('onclick', 'pk2_odev_spam_rewrite(); return false;');
 store_rewrite_link.setAttribute('style', 'color: white; margin: 0px 3px');
	store_rewrite_link.textContent = 'Zmień nazwe.';
	wear_spam2.appendChild(store_rewrite_link);
	var delete_link = document.createElement('a');
	delete_link.setAttribute('href', '#');
	delete_link.setAttribute('title', 'Usunięcie zestawu');
	delete_link.setAttribute('style', 'margin-right: 7px');
	delete_link.setAttribute('onclick', 'confirm (\"Usunąć zestaw?\")?pk2_odev_spam_del():void(0); return false;');
 delete_link.setAttribute('style', 'color: white');
	delete_link.textContent = 'Usuń';
	wear_spam2.appendChild(delete_link);
	var equip_select = document.createElement('select');
	equip_select.setAttribute('id', 'pk2_spam_select');
	equip_select.setAttribute('class','pk2_sel');
	equip_select.setAttribute('style', 'width: 130px; max-width: 135px; margin: 0px 5px 0px 220px;font-size:100%;');
	wear_spam2.appendChild(equip_select);
	pk2_odev_spam_option();
	var equip_link = document.createElement('a');
	equip_link.setAttribute('href', '#');
	equip_link.setAttribute('id', 'equip_link');
	equip_link.setAttribute('onclick', 'pk2_odev_spam_go(); return false;');
	equip_link.setAttribute('title', 'Spowoduje ubranie się w wybrany zestaw');
 equip_link.setAttribute('style', 'color: white');
	equip_link.textContent = 'Ubierz się';
	wear_spam2.appendChild(equip_link);
	setTimeout(pk2_odev_spam,5000);
};

aWindow.pk2_odev_spam();

});
});